Optimal. Leaf size=138 \[ \frac{\left (a^2-2 b^2\right ) \sin ^6(c+d x)}{6 d}-\frac{\left (2 a^2-b^2\right ) \sin ^4(c+d x)}{4 d}+\frac{a^2 \sin ^2(c+d x)}{2 d}+\frac{2 a b \sin ^7(c+d x)}{7 d}-\frac{4 a b \sin ^5(c+d x)}{5 d}+\frac{2 a b \sin ^3(c+d x)}{3 d}+\frac{b^2 \sin ^8(c+d x)}{8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12784, antiderivative size = 138, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.111, Rules used = {2837, 12, 772} \[ \frac{\left (a^2-2 b^2\right ) \sin ^6(c+d x)}{6 d}-\frac{\left (2 a^2-b^2\right ) \sin ^4(c+d x)}{4 d}+\frac{a^2 \sin ^2(c+d x)}{2 d}+\frac{2 a b \sin ^7(c+d x)}{7 d}-\frac{4 a b \sin ^5(c+d x)}{5 d}+\frac{2 a b \sin ^3(c+d x)}{3 d}+\frac{b^2 \sin ^8(c+d x)}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2837
Rule 12
Rule 772
Rubi steps
\begin{align*} \int \cos ^5(c+d x) \sin (c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x (a+x)^2 \left (b^2-x^2\right )^2}{b} \, dx,x,b \sin (c+d x)\right )}{b^5 d}\\ &=\frac{\operatorname{Subst}\left (\int x (a+x)^2 \left (b^2-x^2\right )^2 \, dx,x,b \sin (c+d x)\right )}{b^6 d}\\ &=\frac{\operatorname{Subst}\left (\int \left (a^2 b^4 x+2 a b^4 x^2+b^2 \left (-2 a^2+b^2\right ) x^3-4 a b^2 x^4+\left (a^2-2 b^2\right ) x^5+2 a x^6+x^7\right ) \, dx,x,b \sin (c+d x)\right )}{b^6 d}\\ &=\frac{a^2 \sin ^2(c+d x)}{2 d}+\frac{2 a b \sin ^3(c+d x)}{3 d}-\frac{\left (2 a^2-b^2\right ) \sin ^4(c+d x)}{4 d}-\frac{4 a b \sin ^5(c+d x)}{5 d}+\frac{\left (a^2-2 b^2\right ) \sin ^6(c+d x)}{6 d}+\frac{2 a b \sin ^7(c+d x)}{7 d}+\frac{b^2 \sin ^8(c+d x)}{8 d}\\ \end{align*}
Mathematica [A] time = 0.654, size = 138, normalized size = 1. \[ -\frac{840 \left (10 a^2+3 b^2\right ) \cos (2 (c+d x))+420 \left (8 a^2+b^2\right ) \cos (4 (c+d x))+560 a^2 \cos (6 (c+d x))-16800 a b \sin (c+d x)+1120 a b \sin (3 (c+d x))+2016 a b \sin (5 (c+d x))+480 a b \sin (7 (c+d x))-280 b^2 \cos (6 (c+d x))-105 b^2 \cos (8 (c+d x))-2590 b^2}{107520 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.04, size = 101, normalized size = 0.7 \begin{align*}{\frac{1}{d} \left ( -{\frac{{a}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{6}}{6}}+2\,ab \left ( -1/7\,\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{6}+1/35\, \left ( 8/3+ \left ( \cos \left ( dx+c \right ) \right ) ^{4}+4/3\, \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) \right ) +{b}^{2} \left ( -{\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{6}}{8}}-{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{6}}{24}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.993132, size = 146, normalized size = 1.06 \begin{align*} \frac{105 \, b^{2} \sin \left (d x + c\right )^{8} + 240 \, a b \sin \left (d x + c\right )^{7} - 672 \, a b \sin \left (d x + c\right )^{5} + 140 \,{\left (a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )^{6} + 560 \, a b \sin \left (d x + c\right )^{3} - 210 \,{\left (2 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{4} + 420 \, a^{2} \sin \left (d x + c\right )^{2}}{840 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.74325, size = 220, normalized size = 1.59 \begin{align*} \frac{105 \, b^{2} \cos \left (d x + c\right )^{8} - 140 \,{\left (a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{6} - 16 \,{\left (15 \, a b \cos \left (d x + c\right )^{6} - 3 \, a b \cos \left (d x + c\right )^{4} - 4 \, a b \cos \left (d x + c\right )^{2} - 8 \, a b\right )} \sin \left (d x + c\right )}{840 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 12.8605, size = 163, normalized size = 1.18 \begin{align*} \begin{cases} - \frac{a^{2} \cos ^{6}{\left (c + d x \right )}}{6 d} + \frac{16 a b \sin ^{7}{\left (c + d x \right )}}{105 d} + \frac{8 a b \sin ^{5}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{15 d} + \frac{2 a b \sin ^{3}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{3 d} + \frac{b^{2} \sin ^{8}{\left (c + d x \right )}}{24 d} + \frac{b^{2} \sin ^{6}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{6 d} + \frac{b^{2} \sin ^{4}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{4 d} & \text{for}\: d \neq 0 \\x \left (a + b \sin{\left (c \right )}\right )^{2} \sin{\left (c \right )} \cos ^{5}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.21535, size = 205, normalized size = 1.49 \begin{align*} \frac{b^{2} \cos \left (8 \, d x + 8 \, c\right )}{1024 \, d} - \frac{a b \sin \left (7 \, d x + 7 \, c\right )}{224 \, d} - \frac{3 \, a b \sin \left (5 \, d x + 5 \, c\right )}{160 \, d} - \frac{a b \sin \left (3 \, d x + 3 \, c\right )}{96 \, d} + \frac{5 \, a b \sin \left (d x + c\right )}{32 \, d} - \frac{{\left (2 \, a^{2} - b^{2}\right )} \cos \left (6 \, d x + 6 \, c\right )}{384 \, d} - \frac{{\left (8 \, a^{2} + b^{2}\right )} \cos \left (4 \, d x + 4 \, c\right )}{256 \, d} - \frac{{\left (10 \, a^{2} + 3 \, b^{2}\right )} \cos \left (2 \, d x + 2 \, c\right )}{128 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]